package com.ms.game.invitefriend.db;

import java.util.Calendar;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.xpec.c4.db.model.basic.BasicModel;
import com.xpec.c4.game.time.TimeSys;

@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = "distributor_subs")
@org.hibernate.annotations.Table(
		appliesTo = "distributor_subs", indexes = 
		{
				@org.hibernate.annotations.Index(name = "IDX_GUID", columnNames = { "subDistributorGuid"})
				
		})
public class SubDistributorsModel extends BasicModel{
	/**
	 * 
	 */
	private static final long serialVersionUID = 9170884969968306051L;

	public SubDistributorsModel() {
		eventTime = Calendar.getInstance();
		createTime = TimeSys.currentTimeMills();
	}
	
	private int id;

	/** 
	 * 紀錄時間
	 */
	private Calendar eventTime;
	
	/** 
	 * 遊戲時間
	 */
	private long createTime; 

	/**
	 * 母經銷商ID
	 */
	private String distributorGuid;
	
	/**
	 * 子經銷商 ID
	 */
	private String subDistributorGuid;
	
	/**
	 * 子經銷商名稱
	 */
	private String subDistributorName;
	
	/**
	 * 子經銷商被分配的邀請碼數量
	 */
	private int inviteCodeNum;
	
	/**
	 * 每次下線升級，母經銷商可以從子經銷商抽的金額
	 */
	private int levelUpMoneyComm;
	
	/**
	 * 下線到達指定等級，母經銷商可以從子經銷商抽的金額
	 */
	private int designatedLeveMoneyComm;
	
	/**
	 * 是否修改
	 */
	private boolean isModify;
	
	/**
	 * 可以修改的時間
	 */
	private Date modifyTime;
	
	/**
	 * 修改每次下線升級，母經銷商可以從子經銷商抽的金額
	 */
	private int modifyLevelUpMoneyComm;
	
	/**
	 * 修改下線到達指定等級，母經銷商可以從子經銷商抽的金額
	 */
	private int modifyDesignatedLeveMoneyComm;
	
	/**
	 * 是否是第一次設定
	 */
	private boolean afterFirstSetting;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Calendar getEventTime() {
		return eventTime;
	}

	public void setEventTime(Calendar eventTime) {
		this.eventTime = eventTime;
	}

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public String getDistributorGuid() {
		return distributorGuid;
	}

	public void setDistributorGuid(String distributorGuid) {
		this.distributorGuid = distributorGuid;
	}

	public String getSubDistributorGuid() {
		return subDistributorGuid;
	}

	public void setSubDistributorGuid(String subDistributorGuid) {
		this.subDistributorGuid = subDistributorGuid;
	}

	public String getSubDistributorName() {
		return subDistributorName;
	}

	public void setSubDistributorName(String subDistributorName) {
		this.subDistributorName = subDistributorName;
	}

	public int getInviteCodeNum() {
		return inviteCodeNum;
	}

	public void setInviteCodeNum(int inviteCodeNum) {
		this.inviteCodeNum = inviteCodeNum;
	}

	public int getLevelUpMoneyComm() {
		return levelUpMoneyComm;
	}

	public void setLevelUpMoneyComm(int levelUpMoneyComm) {
		this.levelUpMoneyComm = levelUpMoneyComm;
	}

	public int getDesignatedLeveMoneyComm() {
		return designatedLeveMoneyComm;
	}

	public void setDesignatedLeveMoneyComm(int designatedLeveMoneyComm) {
		this.designatedLeveMoneyComm = designatedLeveMoneyComm;
	}

	public boolean isModify() {
		return isModify;
	}

	public void setModify(boolean isModify) {
		this.isModify = isModify;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public int getModifyLevelUpMoneyComm() {
		return modifyLevelUpMoneyComm;
	}

	public void setModifyLevelUpMoneyComm(int modifyLevelUpMoneyComm) {
		this.modifyLevelUpMoneyComm = modifyLevelUpMoneyComm;
	}

	public int getModifyDesignatedLeveMoneyComm() {
		return modifyDesignatedLeveMoneyComm;
	}

	public void setModifyDesignatedLeveMoneyComm(int modifyDesignatedLeveMoneyComm) {
		this.modifyDesignatedLeveMoneyComm = modifyDesignatedLeveMoneyComm;
	}
	
	public boolean isAfterFirstSetting() {
		return afterFirstSetting;
	}

	public void setAfterFirstSetting(boolean afterFirstSetting) {
		this.afterFirstSetting = afterFirstSetting;
	}
}

